#pragma once

#include "Include.h"

struct Square
{
	int x;
	int y;
	Square() {x = y = 0;}
	Square(int _x, int _y) {x = _x; y = _y; }
};

class GomokuBoard
{
public:
	GomokuBoard(void);
	GomokuBoard(Board data);
	GomokuBoard(std::istream &stream);
	GomokuBoard(GomokuBoard &_parent, Square _move, int _playerNum);
	~GomokuBoard(void);

	int Get(int x, int y);
	void Set(int x, int y, int value);
	bool InBounds(int x, int y);
	bool CheckForWin(int _player); //returns 1 if player 1 has won, 2 if player 2 has won, and 0 if no one has won
	std::vector<Square> PossibleMoves(int _playerNum);
	void GetBoard(Board &board);

	void Write(std::ostream &stream);
	void Parse(std::istream &stream);
private:
	int data[boardHeight*boardWidth];
};
